package com.wit.witmg.mapper;

import com.wit.witmg.entity.TPurchase;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author bob
 * @since 2025-01-14
 */
public interface TPurchaseMapper extends BaseMapper<TPurchase> {

    @Update("update t_purchase set xj=xj+1 where id=#{pid}")
    void upxj(@Param("pid") Integer pid);

    @Update("update t_purchase set bj=bj+1 where id=#{pid}")
    void upbj(@Param("pid") Integer pid);

    @Update("update t_purchase set stat=#{stat} where id=#{pid} and stat< #{stat}")
    void upStat(@Param("pid") Integer pid, @Param("stat") Integer stat);
}
